public class Babytalk
{
   final static boolean DEBUGGING = true;

   private static void interpret(String fname)
   {
      try
      {
         Interpreter interpreter = new Interpreter(fname);
         interpreter.interpret();
      }
      catch (Exception e)
      {
         System.err.println(fname + ": error: " + e);
         if (DEBUGGING)
            e.printStackTrace();
      }
   }
   
   private static void test()
   {
      String[] files = { 
         "error1.bt",
         "error2.bt",
         "error3.bt",
         "error4.bt",
         "ok1.bt",
         "sample.bt"
         };

      for (String fname : files)
         interpret(fname);
   }
   
   public static void main(String[] args)
   {
      if (args.length > 0 && args[0].equals("--test"))
      {
         test();
         return;
      }
      
      for (String fname : args)
         interpret(fname);
	}
}
